<TagAttribute("sound","snd!","????","????",4,164)>
Public Class SOUND_TAG
Inherits HaloTag
Public Const Extension as String = "sound"
Public Const FourCC as String = "snd!"
Public Const ParentFourCC as String = "????"
Public Const GrandParentFourCC as String = "????"
Public Const [Version] as Short = 4
Public Const HeaderLength as Integer = 164

''' <summary>
''' 
''' </summary>
<TagField("flags", 1, 20)>
Public flags as Integer

''' <summary>
''' 
''' </summary>
<TagField("class", 1, 17)>
Public _class as Short

''' <summary>
''' 
''' </summary>
<TagField("sample rate", 1, 17)>
Public sample_rate as Short

''' <summary>
''' the distance below which this sound no longer gets louder
''' </summary>
<TagField("minimum distance:world units", 1, 0)>
Public minimum_distance as Single

''' <summary>
''' the distance beyond which this sound is no longer audible
''' </summary>
<TagField("maximum distance:world units", 1, 0)>
Public maximum_distance as Single

''' <summary>
''' fraction of requests to play this sound that will be ignored (0 means always play.)
''' </summary>
<TagField("skip fraction", 1, 0)>
Public skip_fraction as Single

''' <summary>
''' these settings control random variation of volume and pitch.
''' </summary>
#Region "randomization"

''' <summary>
''' the sound's pitch will be randomly selected and will be in this range. (1.0 is the recorded pitch.)
''' </summary>
<TagField("random pitch bounds", 2, 1)>
Public random_pitch_bounds as Single()

''' <summary>
''' within the cone defined by this angle and the sound's direction, the sound plays with a gain of 1.0.
''' </summary>
<TagField("inner cone angle:degrees", 1, 0)>
Public inner_cone_angle as Single

''' <summary>
''' outside the cone defined by this angle and the sound's direction, the sound plays with a gain of OUTER CONE GAIN. (0 means the sound does not attenuate with direction.)
''' </summary>
<TagField("outer cone angle:degrees", 1, 0)>
Public outer_cone_angle as Single

''' <summary>
''' the gain to use when the sound is directed away from the listener
''' </summary>
<TagField("outer cone gain", 1, 0)>
Public outer_cone_gain as Single

''' <summary>
''' 
''' </summary>
<TagField("gain modifier", 1, 0)>
Public gain_modifier as Single

''' <summary>
''' 
''' </summary>
<TagField("maximum bend per second", 1, 0)>
Public maximum_bend_per_second as Single

''' <summary>
''' 
''' </summary>
<TagField("", 12, -1)>
Public padding as Byte()

''' <summary>
''' as the sound's input scale changes from zero to one, these modifiers move between the two values specified here. the sound will play using the current scale modifier multiplied by the value specified above. (0 values are ignored.)
''' </summary>
#End Region
#Region "when scale is ZERO"

''' <summary>
''' 
''' </summary>
<TagField("skip fraction modifier", 1, 0)>
Public skip_fraction_modifier as Single

''' <summary>
''' 
''' </summary>
<TagField("gain modifier", 1, 0)>
Public gain_modifier_1 as Single

''' <summary>
''' 
''' </summary>
<TagField("pitch modifier", 1, 0)>
Public pitch_modifier as Single

''' <summary>
''' 
''' </summary>
<TagField("", 12, -1)>
Public padding_1 as Byte()

''' <summary>
''' as the sound's input scale changes from zero to one, these modifiers move between the two values specified here. the sound will play using the current scale modifier multiplied by the value specified above. (0 values are ignored.)
''' </summary>
#End Region
#Region "when scale is ONE"

''' <summary>
''' 
''' </summary>
<TagField("skip fraction modifier", 1, 0)>
Public skip_fraction_modifier_1 as Single

''' <summary>
''' 
''' </summary>
<TagField("gain modifier", 1, 0)>
Public gain_modifier_2 as Single

''' <summary>
''' 
''' </summary>
<TagField("pitch modifier", 1, 0)>
Public pitch_modifier_1 as Single

''' <summary>
''' 
''' </summary>
<TagField("", 12, -1)>
Public padding_2 as Byte()

''' <summary>
''' 
''' </summary>
#End Region
#Region "import properties"

''' <summary>
''' 
''' </summary>
<TagField("encoding", 1, 17)>
Public encoding as Short

''' <summary>
''' 
''' </summary>
<TagField("compression", 1, 17)>
Public compression as Short

''' <summary>
''' 
''' </summary>
<TagField("promotion sound", 16, 10)>
Public promotion_sound as New TAG_REFERENCE

''' <summary>
''' when there are this many instances of the sound, promote to the new sound.
''' </summary>
<TagField("promotion count", 1, 23)>
Public promotion_count as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding_3 as Byte()

''' <summary>
''' 
''' </summary>
<TagField("", 20, -1)>
Public padding_4 as Byte()

''' <summary>
''' sound_pitch_range_block
''' </summary>
<TagField("pitch ranges#pitch ranges allow multiple samples to represent the same sound at different pitches", 72, 11)>
Public pitch_ranges as List(Of PITCH_RANGES_BLOCK)
#End Region
Public Class PITCH_RANGES_BLOCK

''' <summary>
''' 
''' </summary>
<TagField("name", 32, 8)>
Public name as String

''' <summary>
''' these settings control what pitches this set of samples represents. if there is only one pitch range, all three values are ignored.
''' </summary>
#Region "pitch control"

''' <summary>
''' the apparent pitch when these samples are played at their recorded pitch.
''' </summary>
<TagField("natural pitch", 1, 0)>
Public natural_pitch as Single

''' <summary>
''' the range of pitches that will be represented using this sample. this should always contain the natural pitch.
''' </summary>
<TagField("bend bounds", 2, 1)>
Public bend_bounds as Single()

''' <summary>
''' 
''' </summary>
<TagField("actual permutation count", 1, 23)>
Public actual_permutation_count as Short

''' <summary>
''' 
''' </summary>
<TagField("", 2, -1)>
Public padding as Byte()

''' <summary>
''' 
''' </summary>
<TagField("", 12, -1)>
Public padding_1 as Byte()

''' <summary>
''' sound_permutations_block
''' </summary>
<TagField("permutations#permutations represent equivalent variations of this sound.", 124, 11)>
Public permutations as List(Of PERMUTATIONS_BLOCK)
#End Region
Public Class PERMUTATIONS_BLOCK

''' <summary>
''' name of the file from which this sample was imported
''' </summary>
<TagField("name^", 32, 8)>
Public name as String

''' <summary>
''' fraction of requests to play this permutation that are ignored (a different permutation is selected.)
''' </summary>
<TagField("skip fraction", 1, 0)>
Public skip_fraction as Single

''' <summary>
''' fraction of recorded volume to play at.
''' </summary>
<TagField("gain", 1, 0)>
Public gain as Single

''' <summary>
''' 
''' </summary>
<TagField("compression", 1, 17)>
Public compression as Short

''' <summary>
''' 
''' </summary>
<TagField("next permutation index", 1, 23)>
Public next_permutation_index as Short

''' <summary>
''' 
''' </summary>
<TagField("", 8, -1)>
Public padding as Byte()

''' <summary>
''' 
''' </summary>
<TagField("", 1, 27)>
Public unknown as Integer

''' <summary>
''' 
''' </summary>
<TagField("", 4, -1)>
Public padding_1 as Byte()

''' <summary>
''' 
''' </summary>
<TagField("", 1, 27)>
Public unknown_1 as Integer

''' <summary>
''' 
''' </summary>
<TagField("samples#sampled sound data", 1, 16)>
Public samples as New DATA_CONTAINER

''' <summary>
''' 
''' </summary>
<TagField("mouth data", 1, 22)>
Public mouth_data as New DATA_CONTAINER

''' <summary>
''' 
''' </summary>
<TagField("subtitle data", 1, 22)>
Public subtitle_data as New DATA_CONTAINER

End Class

End Class

End Class
